<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Coa extends Authenticated_Controller{
	function __construct() {
		parent::__construct();
		$this->load->model('coa_model','coa');
	}
	
	function index(){
		$this->list_coa();
	}
	
	function list_coa(){
		$data['daftar_coa'] = $this->coa->get_all();
		$this->load->view('template/header_view');
		$this->load->view('coa/daftar_coa',$data);
		$this->load->view('template/footer_view');
	}
	
	function form_add_coa(){
		$this->load->view('template/header_view');
		$this->load->view('coa/form_add_coa');
		$this->load->view('template/footer_view');
	}
	
	function process_add_coa(){
		$this->coa->insert_new($_POST);
		redirect(COA);
	}
	
	function process_delete_coa($id){
		$this->coa->delete_old($id);
		redirect(COA);
	}
	
	function form_edit_coa($id){
		$data = $this->coa->get_one($id);
		$this->load->view('template/header_view');
		$this->load->view('coa/form_edit_coa',$data);
		$this->load->view('template/footer_view');
	}
	
	function process_edit_coa($id){
		$this->coa->update_old($id,$_POST);
		redirect(COA);
	}
}

/* End of file home.php */
/* Location: ./application/controllers/home.php */
